"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.checkParam = checkParam;
function checkParam(ctx, by) {
  Object.keys(by).map(function (key) {

    if (!by[key].test(ctx.request.body[key])) {
      console.log(key, ctx.request.body[key], by[key], " Check Failed.");
      ctx.throw(300, "params format error!");
    } else {
      console.log(key, ctx.request.body[key], by[key], " Check Ok.");
    }
  });
}